# 无需手动关闭close
import pymysql


with pymysql.connect(user='root',password='123456',host='master',port=3306,database='student') as conn:
    with conn.cursor() as cursor:
        nums=cursor.execute("select*from student where age>%s",23)
        for i in range(nums):
            print(cursor.fetchone())

